/**
 * Created by Administrator on 2017/12/18 0018.任务管理
 */
import dynamic from 'dva/dynamic';

// wrapper of dynamic
const dynamicWrapper = (app, models, component) => dynamic({
  app,
  models: () => models.map(m => import(`../models/${m}.js`)),
  component,
});


export const TaskManager = (app) => {
  return {
    name: '任务管理',
    icon: 'renwuguanli',
    path: 'taskmanager',
    children: [
      {
        name: '任务列表',
        path: 'tasklist',
        component: dynamicWrapper(app, [], () => import('../routes/TaskManange/TaskList')),
      },
      {
        name: '',
        path: 'taskDetail',
        component: dynamicWrapper(app, [], () => import('../routes/TaskManange/TaskDetail/IndexTaskDetail.js')),
      },
      // {
      //   name: '创建任务-基本信息',
      //   path: 'createtaskinformation',
      //   component: dynamicWrapper(app, [], () => import('../routes/TaskManange/CreateTask/CreateTaskInformation')),
      // },
      // {
      //   name: '创建任务-出勤设置',
      //   path: 'createtaskattendance',
      //   component: dynamicWrapper(app, [], () => import('../routes/TaskManange/CreateTask/CreateTaskAttendance')),
      // },
      // {
      //   name: '创建任务-发布设置',
      //   path: 'createpublish',
      //   component: dynamicWrapper(app, [], () => import('../routes/TaskManange/CreateTask/CreatePublish')),
      // },

      {
        name: '',
        path: 'tasksuccess',
        component: dynamicWrapper(app, [], () => import('../routes/TaskManange/CreateTask/TaskSuccess')),
      },
      {
        name: '',
        path: 'taskdetailbasicinfomation',
        component: dynamicWrapper(app, [], () => import('../routes/TaskManange/TaskDetail/TaskDetailBasicInfomation')),
      },
      {
        name: '',//任务详情-出勤规则
        path: 'taskdetailattendancerules',
        component: dynamicWrapper(app, [], () => import('../routes/TaskManange/TaskDetail/TaskDetailAttendanceRules')),
      },
      {
        name: '',//任务详情-任务成员名单
        path: 'taskdetailpublishsetting',
        component: dynamicWrapper(app, [], () => import('../routes/TaskManange/TaskDetail/TaskDetailPublishSetting')),
      },
      {
        name: '',//任务详情-人员排班
        path: 'taskdetailpersonnelplacement',
        component: dynamicWrapper(app, [], () => import('../routes/TaskManange/TaskDetail/TaskDetailPersonnelPlacement')),
      },
      {
        name: '',//任务详情-调班-代班
        path: 'taskdetailshift',
        component: dynamicWrapper(app, [], () => import('../routes/TaskManange/TaskDetail/TaskDetailShift')),
      },
      {
        name: '',//任务详情-调班-班次分配
        path: 'taskdetailshiftdistribution',
        component: dynamicWrapper(app, [], () => import('../routes/TaskManange/TaskDetail/TaskDetailShiftDistribution')),
      },
      {
        name: '',//任务详情-调班-增援
        path: 'taskdetailshiftreinforce',
        component: dynamicWrapper(app, [], () => import('../routes/TaskManange/TaskDetail/TaskDetailShiftReinforce')),
      },
      {
        name: '',//任务详情-出勤及轨迹
        path: 'taskdetailattendancetrack',
        component: dynamicWrapper(app, [], () => import('../routes/TaskManange/TaskDetail/TaskDetailAttendanceTrack')),
      },
      {
        name: '',//任务详情-任务动态
        path: 'taskdetailtaskdynamics',
        component: dynamicWrapper(app, [], () => import('../routes/TaskManange/TaskDetail/TaskDetailTaskDynamics')),
      },
      {
        name: '',//任务详情-关联事项
        path: 'taskdetailrelatedmatters',
        component: dynamicWrapper(app, [], () => import('../routes/TaskManange/TaskDetail/TaskDetailRelatedMatters')),
      },
      {
        name: '任务班次管理',
        path: 'newshift2',
        component: dynamicWrapper(app, ['monitor'], () => import('../routes/AttendanceManagement/NewShift')),
      },
      {
        name: '',
        path: 'newtask',
        component: dynamicWrapper(app, [], () => import('../routes/TaskManange/NewTask')),
      },
    ],
  };
};
